package com.itheima.exer.exercise.ex0924;

import java.util.Arrays;

public class Demo9 {
    public static void main(String[] args) {
        int[] arr = {1, 332, 43, 25, 3324, 34, 335, 4, 45, 2, 43, 52, 54};
        System.out.println(Arrays.toString(arr));
        for (int j = 0; j < arr.length - 1; j++) {
            for (int i = 0; i < arr.length - 1 - j; i++) {
                if (arr[i] > arr[i+1]){
                    int temp = arr[i];
                    arr[i] = arr[i+1];
                    arr[i+1] = temp;
                }
            }
        }
        System.out.println(Arrays.toString(arr));
    }
}
/**
 *  第一轮 1,  43,25, 332, 3324
 *  第二轮 1,  25, 43,332, 3324
 *  第三论 1,  25, 43,332, 3324
 */
